import request from "@/utils/request";

// 查询轮播图列表
export function listBanner(query) {
    return request({
        url: '/shop/banner/list',
        method: 'get',
        params: query
    })
}

// 查询轮播图详细
export function getBanner(id) {
    return request({
        url: '/shop/banner/' + id,
        method: 'get'
    })
}

// 新增轮播图
export function addBanner(data) {
    return request({
        url: '/shop/banner',
        method: 'post',
        data: data
    })
}

// 修改轮播图
export function updateBanner(data) {
    return request({
        url: '/shop/banner',
        method: 'put',
        data: data
    })
}

// 删除轮播图
export function delBanner(id) {
    return request({
        url: '/shop/banner/' + id,
        method: 'delete'
    })
}


// 找回密码
export function UserRetrieve(data) {
    return request({
        url: '/public/user/retrieve',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}

// 退出登陆
export function UserLogout() {
    return request({
        url: '/logout',
        method: 'get',
    })
}

// 获取用户信息-简短
export function UserInfoShort() {
    return request({
        url: '/user/info/short',
        method: 'get',
    })
}

// 获取用户信息-名字头像
export function UserInfoForPost(data){
    return request({
        url: '/user/info/forPost?userId=' + data,
        method: 'get',
    })
}
